<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a >列表</a></li>
		</ul>
        
        <form class="well form-inline margin-top-20" method="post" action="{:url('conversa/index')}">
            通话类型：
            <select class="form-control" name="type" style="width: 150px;">
                <option value=''>全部</option>
                <volist name="type" id="v">
                    <option value="{$key}" <if condition="input('request.type') neq '' && input('request.type') eq $key">selected</if>>{$v}</option>
                </volist>
            </select>
            通话状态：
            <select class="form-control" name="status" style="width: 150px;">
                <option value=''>全部</option>
                <volist name="status" id="v">
                <option value="{$key}" <if condition="input('request.status') neq '' && input('request.status') eq $key">selected</if>>{$v}</option>
                </volist>
            </select>
            赠送时间：
            <input class="form-control js-bootstrap-date" name="start_time" id="start_time" value="{:input('request.start_time')}" aria-invalid="false" style="width: 110px;"> - 
            <input class="form-control js-bootstrap-date" name="end_time" id="end_time" value="{:input('request.end_time')}" aria-invalid="false" style="width: 110px;">
            用户ID：
            <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
                   placeholder="用户ID">
            <input type="submit" class="btn btn-primary" value="搜索"/>
            <a class="btn btn-danger" href="{:url('conversa/index')}">清空</a>
        </form>
    
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>ID</th>
						<th>通话类型</th>
						<th>通话状态</th>
						<th>用户</th>
						<th>主播</th>
						<th>价格/分</th>
						<th>礼物收益</th>
						<th>通话收益</th>
						<th>时间</th>
						<th>时长</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="list" item="vo">
					<tr>
						<td>{$vo['id']}</td>
                        <td>{$type[$vo['type']]}</td>
                        <td>{$status[$vo['status']]}</td>
						<td>{$vo['userinfo']['user_nickname']} ( {$vo['uid']} )</td>
						<td>{$vo['liveinfo']['user_nickname']} ( {$vo['liveuid']} )</td>
                        <td>{$vo['coin']}</td>
						<td>{$vo['gift']}</td>
						<td>{$vo['total']}</td>
                        <td>
                        <if condition="$vo['starttime'] && $vo['endtime']">
                        {:date('Y-m-d H:i:s',$vo['starttime'])} - {:date('Y-m-d H:i:s',$vo['endtime'])}
                        <elseif condition="$vo['status'] eq 1"/>
                        通话中
                        <else/>
                        未接通
                        </if>
                        </td>
                        <td>{$vo['length']}</td>
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>

		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>